//
//  Friend.m
//  QQ_Youngsher
//
//  Created by Maxwell on 16/1/15.
//  Copyright © 2016年 LLLTeam. All rights reserved.
//

#import "Friend.h"

@implementation Friend

- (instancetype)init{
    self = [super init];
    if (self) {
        self.offNews = @"0";
        self.newsDate = @"0";
    }
    return self;
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    if ([key isEqualToString:@"friend_id"]) {
        [self setValue:value forKey:@"id"];
    }
}

- (void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:_avatar forKey:@"avatar"];
    [aCoder encodeObject:_intro forKey:@"intro"];
    [aCoder encodeObject:_nickname forKey:@"nickname"];
    [aCoder encodeObject:_friend_id forKey:@"friend_id"];
    [aCoder encodeObject:_offNews forKey:@"offNews"];
    [aCoder encodeObject:_newsListArray forKey:@"newsListArray"];
    [aCoder encodeObject:_newsDate forKey:@"newsDate"];
    [aCoder encodeBool:_followStatus forKey:@"followStatus"];

}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
    if (self = [super init]) {
        _avatar = [aDecoder decodeObjectForKey:@"avatar"];
        _intro = [aDecoder decodeObjectForKey:@"intro"];
        _nickname = [aDecoder decodeObjectForKey:@"nickname"];
        _friend_id = [aDecoder decodeObjectForKey:@"friend_id"];
        _offNews = [aDecoder decodeObjectForKey:@"offNews"];
        _newsListArray = [aDecoder decodeObjectForKey:@"newsListArray"];
        _newsDate = [aDecoder decodeObjectForKey:@"newsDate"];
        _followStatus = [aDecoder decodeBoolForKey:@"followStatus"];

    }
    return self;
}


@end
